package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.AnyBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.SetDefaultContract;
import com.seveneight.baijiesteward.ui.user.model.SetDefaultModel;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/26.
 */

public class SetDefaultPresenter implements SetDefaultContract.SetDefaultPresenter {

    SetDefaultContract.SetDefaultView setDefaultView;
    SetDefaultContract.SetDefaultModel setDefaultModel;

    public SetDefaultPresenter(SetDefaultContract.SetDefaultView setDefaultView){
        this.setDefaultView=setDefaultView;
        setDefaultModel=new SetDefaultModel();
    }

    @Override
    public void setDefault(Context context, RequestBody body) {
        setDefaultModel.setDefault(context,body, new MyCallBack<AnyBean>() {
            @Override
            public void onSuccess(AnyBean anyBean) {
                setDefaultView.reBackSetDefaultStatus();
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
